<div ng-controller="appsController">
    <div class="row">
        <div class="col-xs-12">
            <div class="box  box-primary">
                <div class="box-header">

                    <div class="input-group" style="width: 500px;">
                        <span class="input-group-addon">
                            <a  ng-click="changePwd(null);">/&nbsp;
                            </a>
                            <a ng-repeat="segment in pwdSegments" ng-click="changePwdUseSegments($index)">
                                {{segment}}/&nbsp;
                            </a>
                            &nbsp;</span>
                        <input type="text" ng-model="search" ng-change="changeSearch();" name="table_search" class="form-control" placeholder="Search">

                        <div class="input-group-btn">
                            <button type="submit" class="btn btn-info"><i class="fa fa-search"></i></button>
                        </div>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body table-responsive no-padding">
                    <table class="table table-hover">
                        <tbody>
                        <tr>
                            <th style="width: 50px;">No.</th>
                            <th style="width: 80px;">Size</th>
                            <th>Name</th>
                            <th style="width: 100px;">Host</th>
                            <th style="width: 60px;">Download</th>
                        </tr>
                        <tr ng-repeat="file in files">
                            <td>{{$index + 1}}</td>
                            <td>{{file.size || '-'}}</td>
                            <td>
                                <a ng-if="isFile(file)" target="_blank" ng-href="{{file.tailUrl}}"><i class="fa fa-file-text-o"></i>&nbsp;{{file.name}}</a>
                                <a ng-if="!isFile(file)" ng-click="changePwd(file.path);"><i class="fa fa-folder"></i>&nbsp;{{file.name}}</a>
                            </td>
                            <td>{{file.host || ''}}</td>
                            <td><a ng-if="isFile(file)" href="{{file.downloadUrl}}"><i class="fa fa-download"></i></a></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>